<?php
class Auth_Model {
	private $user;
	
	public function __construct(){
		$this->user = new User_Model;
		session_start();
	}
	
	public function set_user_data($user, $password){
		if($this->user->look_user($user, $password) == TRUE){
			$user_data = $this->user->get_user_data();
			$_SESSION['user'] = $user_data['user'];
			$_SESSION['password'] = $user_data['password'];
			$_SESSION['access_level'] = $user_data['access_level'];
			return $_SESSION;
		}
		else {
			header("Location: /login.html");
		}
	}
}